<?php

namespace app\web\model;
use think\Model;
use think\Db;

class GoodsModel extends Model
{
    protected $name = 'mall_goods_discount';
    
    // 开启自动写入时间戳
    protected $autoWriteTimestamp = false;
	
	protected function _initialize() {
		parent::_initialize();
	}
	
	const OFF_THE_SHELF = 1;
	const ON_SALE = 2;
	const SOLD_OUT = 3;
	const RECYCLE_BIN = 4;
	const AUDIT = 0;
	
	public static function getText($status) {
		$status = intval($status);
		switch ($status) {
			case self::OFF_THE_SHELF:
				return '下架 1.审核不通过';
			case self::ON_SALE:
				return '出售中';
			case self::SOLD_OUT:
				return '已售罄';
			case self::RECYCLE_BIN:
				return '已删除，在回收站';
			case self::AUDIT:
				return '审核中';
		}
	}
}